/**
  * Author: Mei
  * Date: 2021-01-05 15:06
  * Description: 
  *
  */
#include <memory>
#include <iostream>

using namespace std;

int main() {
    shared_ptr<int> sp(new int(1));
    shared_ptr<int> sp1 = sp;
    sp1.reset(new int(20));
    cout << *sp << endl;
    cout << *sp1 << endl;

    //获取原始指针
    int *p = sp1.get();

    //指定删除器
    shared_ptr<int> p1(new int[10], [](int *p) {
        cout << "delete destory" << endl;
        delete[] p;
    });



}